{% extends 'GessehCoreBundle::layout.html.twig' %}

{% block titlecontent %}Terrains de stage{% endblock %}

{% block content %}
<table>
  <thead>
    <tr>
      <th>Hôpital</th>
      <th>Service</th>
      <th>Chef de service</th>
      <th>Catégorie</th>
      {% if kparam('simul_active') == true and is_granted('ROLE_STUDENT') %}<th class="small">Postes</th>{% endif %}
      <th class="actions">Actions</th>
    </tr>
  </thead>
  <tbody>
    {% for department in departments %}
      <tr>
        <td><a href="{{ path('GCore_FSShowHospital', {id: department.hospital.id}) }}" title="Afficher les informations de l'hôpital '{{ department.hospital.name }}'">{{ department.hospital }}</a></td>
        <td><a href="{{ path('GCore_FSShowDepartment', {id: department.id}) }}" title="Afficher les informations du service '{{ department.name }}'">{{ department.name }}</a></td>
        <td>{{ department.head }}</td>
        <td>{{ department.sector }}</td>
        {% if kparam('simul_active') == true and is_granted('ROLE_STUDENT') %}<td class="small">{{ department.number }}</td>{% endif %}
        <td>
          <ul>
            <li><a href="{{ path('GCore_FSShowDepartment', {id: department.id}) }}" title="Afficher les informations du service '{{ department.name }}'">Afficher</a></li>
            {% if kparam('eval_active') == true and is_granted('ROLE_STUDENT') %}<li><a href="{{ path('GEval_DShow', { 'id': department.id }) }}" title="Afficher les évaluations du service '{{ department.name }}'">Évaluations</a></li>{% endif %}
          </ul>
        </td>
      </tr>
    {% else %}
      <tr><td colspan="5">Aucun service enregistré</td></tr>
    {% endfor %}
  </tbody>
</table>
{% endblock %}
